function dataAcquisitionSimulation( ~, ~, nChannels, nPoints ) 
%DATAACQUISITIONSIMULATION Fill the current data window to simulate eeg 
%   data acquisition. This function is run as the callback of the data
%   acquisition timer.
%
%   INPUT ARGUMETNS
%   hObject: handle to the acquisition simulation timer.
%   eventdata: event information of the timer event. For backward compatibility,
%       this argument is left unused.
%   nChannels: the number of the eeg channels.
%   nPoints: the number of the points which is held by the currentWindow.

%   Copyright 2012-2015 Kang M.X. Beijing Normal University.
%   $Revision: 1.0.0 $ $Date: 2014/5/28 22:19:00 $
%   First edition of the function dataAcquisitionSimualtion

startTime = tic;
global EEGData;
global currentPosition;
global currentWindow;

% Refresh the current data window and update the data pointer.
currentWindow = EEGData(1 : nChannels, currentPosition : currentPosition + nPoints - 1);
currentPosition = currentPosition + nPoints;

disp(currentPosition);

if toc(startTime) > 0.1
    errordlg('Cosume too much time!');
end 

end

